package com.yawn.zerodefect.controller.entity;

/**
 * @author Created by yawn on 2018-01-26 11:54
 */
public class RestResponse {

    private int code;

    private String msg;

    private Object data;

    public RestResponse() {
    }

    public RestResponse(int code) {
        this.code = code;
    }

    public RestResponse(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public RestResponse(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static RestResponse newInstance(int code) {
        return new RestResponse(code);
    }

    public static RestResponse newInstance(int code, String msg) {
        return new RestResponse(code, msg);
    }

    public static RestResponse newInstance(int code, Object data) {
        return new RestResponse(code, null, data);
    }

    public static RestResponse newInstance(int code, String msg, Object data) {
        return new RestResponse(code, msg, data);
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
